<template>
  <!--树形控件-->
  <el-aside width="300px" style="padding: 15px;">
    <el-tree
      v-if="isLoadingTree"
      ref="expandMenuList"
      class="expand-tree"
      :data="setTree"
      node-key="id"
      highlight-current
      :props="defaultProps"
      :expand-on-click-node="false"
      :render-content="renderContent"
      :default-expanded-keys="defaultExpandKeys"
    />
  </el-aside>

<!--  &lt;!&ndash;新增事件节点分类弹窗&ndash;&gt;-->
<!--  <el-dialog-->
<!--    title="新增事件分类"-->
<!--    width="25%"-->
<!--    class="add-event-dialog"-->
<!--    :visible.sync="addEventdialogVisible"-->
<!--    size="tiny">-->
<!--    <el-form ref="addEventForm" :model="addEventForm" :rules="addEventNodeRules">-->
<!--      <el-form-item label="分类名称" prop="categoryName" >-->
<!--        <el-input v-model="addEventForm.categoryName"></el-input>-->
<!--      </el-form-item>-->
<!--      <el-form-item label="分类标识" prop="categoryFlag">-->
<!--        <el-input v-model="addEventForm.categoryFlag"></el-input>-->
<!--      </el-form-item>-->
<!--    </el-form>-->
<!--    <span slot="footer" class="dialog-footer" >-->
<!--    <el-button @click="addEventFormCancleBtn('addEventForm')">取 消</el-button>-->
<!--    <el-button type="primary" @click="addEventFormSubmitBtn('addEventForm')">确 定</el-button>-->
<!--  </span>-->
<!--  </el-dialog>-->
</template>

<script>
export default {
  name: 'TreeRender',
  data: function() {
    return {
      eventCategoryTree: [
        {
          id: 1,
          label: '一级 1',
          addAble: true, // 根据后台给的是否可添加节点，也可以根据当前的node节点自行判断
          delAble: false, // 根据后台给的是否可删除节点，也可以根据当前的node节点自行判断
          parentId: '',
          children: [{
            id: 4,
            label: '二级 1-1',
            addAble: false,
            delAble: true,
            parentId: '1'
          }, {
            id: 5,
            label: '二级 2-1',
            addAble: false,
            delAble: true,
            parentId: '1'
          }, {
            id: 6,
            label: '二级 2-2',
            addAble: false,
            delAble: true,
            parentId: '1'
          }]
        }],
      defaultProps: {
        children: 'children',
        label: 'label'
      },

      /* 触发的当前的节点，放到全局，方便调用*/
      triggerCurrenNodeData: {},
      /* 触发的当前节点*/
      triggerCurrenNode: {},
      /* 新增事件弹窗的输入框数据*/
      addEventdialogVisible: false,
      addEventForm: {
        categoryName: '',
        categoryFlag: ''
      }
    }
  }
}
</script>

<style scoped>

</style>
